<?php
/*
File Name: Wordpress Theme Toolkit
Version: 1.0
Author: Ozh
Author URI: http://planetOzh.com/
*/
/************************************************************************************
 * THEME USERS : Don't touch anything !! Or don't ask the theme author for support (:-0
 ************************************************************************************/
include(dirname(__FILE__).'/themetoolkit.php');

/************************************************************************************
 * FUNCTION ARRAY
 ************************************************************************************/
themetoolkit(
	'mytheme', 
	array(
	'separ1' => 'Typography {separator}',
	'basefontsize' => 'Base Font Size ## The base font size globally affects all font sizes throughout your blog. This can be in any unit (e.g., px, pt, em), but I suggest using a percentage (%). Default is 76%.<br/><em>Format: <strong>Xy</strong> where X = a number and y = its units.</em>',
	'bodyfont' => 'Base Font Family {radio|arial, helvetica, sans-serif|<span style="font-family:arial, helvetica, sans-serif !important;font-weight:bold;">Arial</span> (Helvetica, sans serif)|"courier new", courier, monospace|<span style="font-family:courier new, courier, monospace !important;font-weight:bold;">Courier New</span> (Courier, monospace)|georgia, times, serif|<span style="font-family:georgia, times, serif !important;font-weight:bold;">Georgia</span> (Times, serif)|"lucida console", monaco, monospace|<span style="font-family:lucida console, monaco, monospace !important;font-weight:bold;">Lucida Console</span> (Monaco, monospace)|"lucida sans unicode", lucida grande, sans-serif|<span style="font-family:lucida sans unicode, lucida grande !important;font-weight:bold;">Lucida Sans Unicode</span> (Lucida Grande, sans serif)|tahoma, geneva, sans-serif|<span style="font-family:tahoma, geneva, sans-serif !important;font-weight:bold;">Tahoma</span> (Geneva, sans serif)|"times new roman", times, serif|<span style="font-family:times new roman, times, serif !important;font-weight:bold;">Times New Roman</span> (Times, serif)|"trebuchet ms", helvetica, sans-serif|<span style="font-family:trebuchet ms, helvetica, sans-serif !important;font-weight:bold;">Trebuchet MS</span> (Helvetica, sans serif)|verdana, geneva, sans-serif|<span style="font-family:verdana, geneva, sans-serif !important;font-weight:bold;">Verdana</span> (Geneva, sans serif)} ## The base font sets the font throughout your blog. A fall-back font and the font family are in parenthesis. Default is Verdana.',
	'postheadingfont' => 'Post Heading Font Family {radio|arial, helvetica, sans-serif|<span style="font-family:arial, helvetica, sans-serif !important;font-weight:bold;">Arial</span> (Helvetica, sans serif)|"courier new", courier, monospace|<span style="font-family:courier new, courier, monospace !important;font-weight:bold;">Courier New</span> (Courier, monospace)|georgia, times, serif|<span style="font-family:georgia, times, serif !important;font-weight:bold;">Georgia</span> (Times, serif)|"lucida console", monaco, monospace|<span style="font-family:lucida console, monaco, monospace !important;font-weight:bold;">Lucida Console</span> (Monaco, monospace)|"lucida sans unicode", lucida grande, sans-serif|<span style="font-family:lucida sans unicode, lucida grande !important;font-weight:bold;">Lucida Sans Unicode</span> (Lucida Grande, sans serif)|tahoma, geneva, sans-serif|<span style="font-family:tahoma, geneva, sans-serif !important;font-weight:bold;">Tahoma</span> (Geneva, sans serif)|"times new roman", times, serif|<span style="font-family:times new roman, times, serif !important;font-weight:bold;">Times New Roman</span> (Times, serif)|"trebuchet ms", helvetica, sans-serif|<span style="font-family:trebuchet ms, helvetica, sans-serif !important;font-weight:bold;">Trebuchet MS</span> (Helvetica, sans serif)|verdana, geneva, sans-serif|<span style="font-family:verdana, geneva, sans-serif !important;font-weight:bold;">Verdana</span> (Geneva, sans serif)} ## This selects the font for headings (h1, h2, h3, etc.) throughout your blog. A fall-back font and the font family are in parenthesis. Default is Arial.',
	'posttextalignment' => 'Post Text Alignment {radio|justify|Justified|left|Left aligned ("Ragged right")|right|Right aligned ("Ragged left")} ## Choose one for the text alignment of the post body text. Default is justified.',
	'separ2' => 'Layout {separator}',
	'layoutwidth' => 'Left &amp; Right Margins ## Enter a number for the left and right margins. Can be in any unit (e.g., px, pt, em), but I suggest using a percentage (%). Any number greater than "0" creates fluid margins. Default is 15%.<br/><em>Format: <strong>Xy</strong> where X = a number and y = its units.</em>',
	'singlepagelayout' => 'Single Post Page Layout {radio|widecolumn|Single Column (no sidebar)|narrowcolumn|Two Column (with sidebar)} ## Select whether to display post pages as a single column (without the sidebar) or in two columns (with the sidebar). Default is single column.',
	'sidebarposition' => 'Sidebar Position {radio|right|Right of content|left|Left of content} ## The sidebar can be position on the right or left on the main content column. Default is right of content.',
	'sidebaralign' => 'Sidebar Text Alignment {radio|center|Centered|left|Left aligned|right|Right Aligned} ## Select one for the text alignment of the sidebar. Default is (controversially) centered.',
	),
	__FILE__
);

/************************************************************************************
 * FUNCTION CALLS
 ************************************************************************************/
function mytheme_layoutwidth() {
	global $mytheme;
	if ( $mytheme->option['layoutwidth'] ) {
		print 'div#everything { margin: 0 ';
		print $mytheme->option['layoutwidth'];
		print "; }\n";
	}
}
function mytheme_basefontsize() {
	global $mytheme;
	if ( $mytheme->option['basefontsize'] ) {
		print 'body { font-size: ';
		print $mytheme->option['basefontsize'];
		print "; }\n";
	}
}
function mytheme_bodyfont() {
	global $mytheme;
	if ( $mytheme->option['bodyfont'] ) {
		print 'body { font-family: ';
		print $mytheme->option['bodyfont'];
		print "; }\n";
	}
}
function mytheme_postheadingfont() {
	global $mytheme;
	if ( $mytheme->option['postheadingfont'] ) {
		print 'h2.post-title { font-family: ';
		print $mytheme->option['postheadingfont'];
		print "; }\n";
	}
}
function mytheme_posttextalignment() {
	global $mytheme;
	if ( $mytheme->option['posttextalignment'] ) {
		print 'div.post p { text-align: ';
		print $mytheme->option['posttextalignment'];
		print "; }\n";
	}
}
function mytheme_singlepagelayout() {
	global $mytheme;
	if ( $mytheme->option['singlepagelayout'] ) {
		print $mytheme->option['singlepagelayout'];
	}
}
function mytheme_sidebarposition() {
	global $mytheme;
	if ($mytheme->option['sidebarposition'] == 'right') {
		echo '
		div#container { float: left; }
		div.narrowcolumn { margin: 0 -210px 0 0; }
		div.narrowcolumn div#content { margin: 0 210px 0 0; }
		div#sidebar { float: right; }
		';
	} else {
		echo '
		div#container { float: right; }
		div.narrowcolumn { margin: 0 0 0 -210px; }
		div.narrowcolumn div#content { margin: 0 0 0 210px; }
		div#sidebar { float: left; }
		';
	}	
}
function mytheme_sidebaralign() {
	global $mytheme;
	if ( $mytheme->option['sidebaralign'] ) {
		print 'div#sidebar { text-align: ';
		print $mytheme->option['sidebaralign'];
		print "; }\n";
	}
}

/************************************************************************************
 * FUNCTION DEFAULTS
 ************************************************************************************/

if ( !$mytheme->is_installed() ) {
	$set_defaults['layoutwidth'] = '15%';
	$set_defaults['basefontsize'] = '76%';
	$set_defaults['bodyfont'] = '"times new roman", times, serif';
	$set_defaults['postheadingfont'] = 'arial, helvetica, sans-serif';
	$set_defaults['singlepagelayout'] = 'widecolumn';
	$set_defaults['posttextalignment'] = 'justify';
	$set_defaults['sidebarposition'] = 'right';
	$set_defaults['sidebaralign'] = 'center';
	$result = $mytheme->store_options($set_defaults) ;
}

/************************************************************************************
 * CALL FOR WIDGETS PLUGIN, V.1
 ************************************************************************************/
if ( function_exists('register_sidebar') )
    register_sidebar();

?>